<?php

$loader = new \Phalcon\Loader();

/**
 * We're a registering a set of directories taken from the configuration file
 */
$loader->registerDirs(
    [
        $config->application->controllersDir,
        $config->application->modelsDir
    ]
);

$loader->registerNamespaces([
    'app\controllers' => $config->application->controllersDir,
    'app\library' => $config->application->libraryDir,
    'app\models' =>  $config->application->modelsDir,
    'app' => APP_PATH . '/',
]);

$loader->register();

require $config->application->vendorDir . 'autoload.php';


return $loader;